import Vue from 'vue'
//1. 导入vue-router 包
import VueRouter from 'vue-router'
//2. 手动安装VueRouter
Vue.use(VueRouter)

import app from './App.vue'

import account from './main/Account.vue'
import goodslist from './main/GoodsList.vue'

// 3. 创建路由对象
var router = new VueRouter({
    routes: [
        // account goodslist
        { path: '/account',component: account},
        {path: '/goodslist',component: goodslist}
    ]
})

var vm = new Vue({
    el: '#app',
    render: c=>c(app),  // render 会把el指定的容器中，所有的内容都清空，
    //所以 不要把路由的router-view和router-link直接写到el所控制的元素中
    router  // 4. 将路由对象挂载到vm上
})